[ToC] [Up] [Back] [Next] ... [Book Plug] |
The Information Commons .................... Introduction to HTML |
Conceptually this is done by creating, on the HTTP server, a map between certain regions and the corresponding action. These regions can be specified as boxes, circles, or enscribed polygons.
Then, when you click on the image, the coordinates of your click are sent down to a program on the server that looks in this database for the action associated with those coordinates.
The program then returns a message back to the browser that tells the browser which document it should access. This is known as a server redirect message, and is one of the standard messages of the HTTP protocol.
bozo.gif
is declared active:
<A HREF="http://www.hprc.ca/cgi-bin/imagemap/path/to/database"> <IMG SRC=bozo.gif ISMAP> </A>The ISMAP attribute declares the image to be active - when you click the mouse over the image the browser sends to the server the pixel coordinates of the mouse, with respect to the image origin.
imagemap
. This program is
designed to process the ISMAP data returned by the browser, and
activates the correct URL by comparing the mouse coordinates with
information in an imagemap database.
The imagemap
script must also be told which
image database to use -- each image will have its own map
database. This is done by
accessing imagemap/path/to/database
where
path/to/database
is the
path to and name of the imagemap database appropriate to the image.
Imagemap takes this extra information (known as "extra path" information)
and uses it to access the indicated database file.
method URL x1,y1 x2,y2 ... xn,ynThe meaning and required number of coordinates (x1,y1) depends on the method. The different methods are:
circle
centre edgepoint
rect
upper_left lower_right
poly
URL
is either a relative or absolute URL. Recall that a
relative URL is a URL to the server being currently accessed, but without
the http://hostname
part, and that in the absence of a leading
slash the document is searched for relative to the directory containing the
current document.
xv
does this quite easily,
as do a number of commercial packages.
Recall that the IMG element can only display GIF and X-bitmap images inlined. Therefore you can only use these format images.
The NCSA ISMAP documentation contains further descriptions of the ISMAP facility, along with examples of an active image and of a map configuration file.
Thomas Boutell has written a nice Windows and UNIX program for graphically
editing an imagemap database file directly from the image. Information about
mapedit can be found at:
http://www.boutell.com/mapedit/.
You can find
other, similar program by looking at typical Web catalog sites, such as
Yahoo!.
[ToC] [Up] [Back] [Next] ... [Book Plug] | .................... Introduction to HTML |
© Ian Graham 1994-1995 | Page Last Updated: 4 December 1995 |